<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/plugin/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
	<style type="text/css">
	.loadingbig{
	width:150px;
	height:150px;
	}
	</style>
	<style type="text/css">
    
    #img_up .img_div{
      position: relative;
        width: 150px;
        height: 150px;
        display: inline-block;
    }
    #img_up .img_div img{
      width: 100%;
        height: 100%;
    
    }
    
     
    #img_up .img_div .deletimg{
      position: absolute;
        top: 5px;
        right: 5px;
        cursor: pointer;
     /*  color:#000; */
    }
    #img_up .img_div .leftPath{
       font-size: 25px;
    position: absolute;
    font-weight: bold;
    right: 120px;
    bottom: -15px;
    }
      #img_up .img_div .rightPath{
        font-size: 25px;
    position: absolute;
    font-weight: bold;
    left: 120px;
    bottom: -15px;
    }
    
  </style>
</head>
<body>
<div class="ibox-content" id="app">
<form class="form-horizontal" id="dataform"
			onsubmit="javascripr:return false;">
	<div class="panel panel-primary" id="bzBuildId">
		<div class="panel-heading">
			<h3 class="panel-title">基本信息</h3>
		</div>
	<div class="panel-body">
	
			<input type="hidden" name="tokenUrl" value="${tokenUrl}">	 
			<input type="hidden" name="token" value="${token}">
		<c:if test="${obj ne null }">
			<input type="hidden" name="actId" value="${obj.actId }">
		</c:if>
		<input type="hidden" name="hacStatus" id="hacStatus" value="${obj.hacStatus }">
		<div class="form-group">
			<label class="col-sm-2 control-label">活动名称
			<span class="text-danger">*</span>
			</label>
			<div class="col-sm-4">
				<input type="text" class="form-control" name="hacName" 
						maxlength="20" dataType="s1-20" 
					value="<c:out value="${obj.hacName }"></c:out>" nullmsg="活动名称不能为空">
			</div>
			<label class="col-sm-2 control-label">小标题
			<span class="text-danger"></span>
			</label>
			<div class="col-sm-4">
				<input type="text" class="form-control" name="hacTitle1" 
					value="<c:out value="${obj.hacTitle1 }"></c:out>">
			</div>
			</div>
			
			<div class="form-group">
			<label class="col-sm-2 control-label">活动价格
				<span class="text-danger">*</span>
				</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" name="hacPrice" 
						dataType="price" id="hacPrice"
						value="<c:out value="${obj.hacPrice }"></c:out>" nullmsg="活动价格不能为空">
				</div>
				<label class="col-sm-2 control-label">助力人数
				<span class="text-danger">*</span>
				</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" name="hacNum" 
							maxi="2" dataType="n1-2" id="hacNum"
						value="<c:out value="${obj.hacNum }"></c:out>" nullmsg="助力人数不能为空">
				</div>
			</div>
			
			<div class="form-group" >
				<label class="col-sm-2 control-label">活动介绍
				<span class="text-danger"></span>
				</label>
				<div class="col-sm-4" >
				 <textarea class="form-control inputtext" placeholder="请输入活动介绍" rows="3" 
				     name="hacIntroduce">${obj.hacIntroduce }</textarea>
				</div>
			</div>
			
			 <div class="form-group" >
				<label class="col-sm-2 control-label">头部图片
				<span class="text-danger">*</span>
				</label>
				<div class="col-sm-4" >
				<input name="hacBackgroundImg" id="hacBackgroundImg" class="input-text upload-url radius form-control inpImg1"
					type="text"   value="${obj.hacBackgroundImg }" readonly style="width:65%;display: inline;"  nullmsg="图片不能为空"/> 
				<a class="btn btn-primary radius upload-a" >
				<i class="fa fa-cloud-upload"></i> 上传图片</a>
				</div>
			</div> 
			 <div class="form-group" >
				<label class="col-sm-2 control-label">分享预览图
				<span class="text-danger">*</span>
				</label>
				<div class="col-sm-4" >
				<input name="hacRemark" id="hacRemark" class="input-text upload-url radius form-control inpImg1" ignore="ignore"
					type="text"   value="${obj.hacRemark }" readonly style="width:65%;display: inline;"  nullmsg="图片不能为空"/> 
				<a class="btn btn-primary radius upload-a" >
				<i class="fa fa-cloud-upload"></i> 上传图片</a>
				</div>
			</div> 
     <div class="form-group" >
				<label class="col-sm-2 control-label">海报图片
				<span class="text-danger">*</span>
				</label>
				<div class="col-sm-4" >
				<input name="hacPosterImg" id="hacPosterImg" class="input-text upload-url radius form-control inpImg1" ignore="ignore"
					type="text"   value="${obj.hacPosterImg }" readonly style="width:65%;display: inline;"  nullmsg="图片不能为空"/> 
				<a class="btn btn-primary radius upload-a" >
				<i class="fa fa-cloud-upload"></i> 上传图片</a>
				</div>
			</div> 
    <div class="form-group">
        <label class="col-sm-2 control-label">详情图片</label>
      <div class="col-sm-8" id="img_up">  
        <div class="img">
          <input name="hacImgs" id="hacImgs" class="input-text upload-url radius form-control inpImg" 
                   type="hidden"  readonly style="width:65%;display: inline;"  value="<c:out value="${obj.hacImgs}"></c:out>"/> 
                     <a class="btn btn-primary radius upload-a" style="width:15%;display: block;">
                   <i class="fa fa-cloud-upload"></i></a>
        </div>
      </div>
      <div class="cl"></div>
    </div>
	
	</div>
		</div>
	<div class="panel panel-primary" >
		<div class="panel-heading">
			<h3 class="panel-title">分享奖励</h3>
		</div>
	<div class="panel-body">
			<div class="form-group">
			<label class="col-sm-1 control-label">奖励名称
			<span class="text-danger">*</span>
			</label>
			<div class="col-sm-3">
				<input type="text" class="form-control" name="bizSharePrize.prizeName" ignore="ignore"
						maxlength="20" dataType="s1-20" nullmsg="奖励名称不能为空" value="<c:out value="${obj.bizSharePrize.prizeName}"></c:out>" >
			</div>
			<label class="col-sm-1 control-label">奖励价格
			<span class="text-danger">*</span>
			</label>
			<div class="col-sm-3">
				<input type="text" class="form-control" id="sharePrizePrice" ignore="ignore" maxlength="20" dataType="price" 
				name="bizSharePrize.prizePrice" value="<c:out value="${obj.bizSharePrize.prizePrice}"></c:out>">
			</div>
			<label class="col-sm-1 control-label">到期时间
				<span class="text-danger">*</span>
				</label>
				<div class="col-sm-3">
					 <input type="text" class="form-control datetimepicker inputtext" 
						name="bizSharePrize.prizeTime"  placeholder="请输入时间"  ignore="ignore" value="<c:out value="${obj.bizSharePrize.prizeTime}"></c:out>">
				</div>
			</div>
			
	</div>
	</div>
	
	<div class="panel panel-primary" >
		<div class="panel-heading">
			<h3 class="panel-title">助力奖励</h3>
		</div>
	<div class="panel-body">
			<div class="form-group">
			<label class="col-sm-1 control-label">奖励名称
			<span class="text-danger">*</span>
			</label>
			<div class="col-sm-3">
				<input type="text" class="form-control"  name="bizHelpPrize.prizeName" ignore="ignore" 
						maxlength="20" dataType="s1-20" nullmsg="奖励名称不能为空"  value="<c:out value="${obj.bizHelpPrize.prizeName}"></c:out>">
			</div>
			<label class="col-sm-1 control-label">奖励价格
			<span class="text-danger">*</span>
			</label>
			<div class="col-sm-3">
				<input type="text" class="form-control" ignore="ignore" maxlength="20" dataType="price"   name="bizHelpPrize.prizePrice" value="<c:out value="${obj.bizHelpPrize.prizePrice}"></c:out>">
			</div>
			<label class="col-sm-1 control-label">到期时间
				<span class="text-danger">*</span>
				</label>
				<div class="col-sm-3">
					 <input type="text" class="form-control datetimepicker inputtext" 
						 name="bizHelpPrize.prizeTime" placeholder="请输入时间"  ignore="ignore" value="<c:out value="${obj.bizHelpPrize.prizeTime}"></c:out>">
				</div>
			</div>
		
	</div>
	</div>
		<div class="panel panel-primary" >
		<div class="panel-heading">
			<h3 class="panel-title">二维码设置</h3>
		</div>
	<div class="panel-body">
			<div class="form-group">
			<label class="col-sm-1 control-label">X轴位置
			<span class="text-danger">*</span>
			</label>
			<div class="col-sm-2">
				<c:if test="${obj.bizCodePosition eq null }"> 
				<input type="text" class="form-control" name="bizCodePosition.x"
						maxlength="10" dataType="n1-10" nullmsg="X轴位置不能为空" 
						value="400" >
						
				</c:if>
				<c:if test="${obj.bizCodePosition ne null }"> 
				<input type="text" class="form-control" name="bizCodePosition.x"
						maxlength="10" dataType="n1-10" nullmsg="X轴位置不能为空" 
						value="<c:out value="${obj.bizCodePosition.x}"></c:out>" >
				</c:if>
			</div>
			<label class="col-sm-1 control-label">Y轴位置
			<span class="text-danger">*</span>
			</label>
			<div class="col-sm-2">
				<%-- <input type="text" class="form-control" maxlength="10" dataType="n1-10" nullmsg="Y轴位置不能为空"
				name="bizCodePosition.y" value="<c:out value="${obj.bizCodePosition.y}"></c:out>"> --%>
				<c:if test="${obj.bizCodePosition eq null }"> 
				<input type="text" class="form-control" name="bizCodePosition.y"
						maxlength="10" dataType="n1-10" nullmsg="Y轴位置不能为空" 
						value="335" >
						
				</c:if>
				<c:if test="${obj.bizCodePosition ne null }"> 
				<input type="text" class="form-control" name="bizCodePosition.y"
						maxlength="10" dataType="n1-10" nullmsg="Y轴位置不能为空" 
						value="<c:out value="${obj.bizCodePosition.y}"></c:out>" >
				</c:if>
			</div>
			<label class="col-sm-1 control-label">宽度
				<span class="text-danger">*</span>
				</label>
				<div class="col-sm-2">
					<%-- <input type="text" class="form-control" maxlength="10" dataType="n1-10" nullmsg="宽度不能为空"
					name="bizCodePosition.width" value="<c:out value="${obj.bizCodePosition.width}"></c:out>"> --%>
					<c:if test="${obj.bizCodePosition eq null }"> 
					<input type="text" class="form-control" name="bizCodePosition.width"
							maxlength="10" dataType="n1-10" nullmsg="宽度不能为空" 
							value="150" >
							
					</c:if>
					<c:if test="${obj.bizCodePosition ne null }"> 
					<input type="text" class="form-control" name="bizCodePosition.width"
							maxlength="10" dataType="n1-10" nullmsg="宽度不能为空" 
							value="<c:out value="${obj.bizCodePosition.width}"></c:out>" >
					</c:if>
				</div>
				<label class="col-sm-1 control-label">高度
				<span class="text-danger">*</span>
				</label>
				<div class="col-sm-2">
					<%-- <input type="text" class="form-control" maxlength="10" dataType="n1-10" nullmsg="高度不能为空"
					name="bizCodePosition.height" value="<c:out value="${obj.bizCodePosition.height}"></c:out>"> --%>
					<c:if test="${obj.bizCodePosition eq null }"> 
					<input type="text" class="form-control" name="bizCodePosition.height"
							maxlength="10" dataType="n1-10" nullmsg="高度不能为空" 
							value="150" >
							
					</c:if>
					<c:if test="${obj.bizCodePosition ne null }"> 
					<input type="text" class="form-control" name="bizCodePosition.height"
							maxlength="10" dataType="n1-10" nullmsg="高度不能为空" 
							value="<c:out value="${obj.bizCodePosition.height}"></c:out>" >
					</c:if>
				</div>
			</div>
			
	</div>
	</div>
			
	<div class="form-group ">
				<div class="col-sm-12 text-center">
					<c:if test="${obj eq null or  (obj.hacStatus  eq '1' or obj.hacStatus  eq '3' )}">
					<a href="javascript:;" onclick="fb()"
						class="btn btn btn-primary radius"><i class="fa fa-check"></i> 发布</a>
						&nbsp;&nbsp;&nbsp;&nbsp;
					</c:if>
				<a href="javascript:;" onclick="bc()"
					class="btn btn-success radius"><i class="fa fa-check"></i>  保存</a>&nbsp;&nbsp;&nbsp;&nbsp; <a
					 class="btn btn-danger radius" href="javascript:;" onclick="MTools.closeForm()" ><i class="fa fa-close"></i> 关闭</a>
			</div>
	
	</div>
	</form>
	</div>
</body>
<script type="text/javascript"
	src="${path }/resource/js/systools/MJsBase.js"></script>

<script type="text/javascript">

	var invokeUrl="${path}/do/admin/bizHelpActivity/addBizHelpActivity"
 	<c:if test="${obj ne null }">
	invokeUrl = "${path}/do/admin/bizHelpActivity/modifyActivity"
	</c:if> 
	var myForm=MForm.initForm({
		invokeUrl:invokeUrl,
		beforeSubmit:function(){
			
		},
		afterSubmit:function(){
			parent.myGrid.serchData();
		},
	})
	
		
	$(function(){
		MUI.initImgUpload1(".inpImg");
		MUI.initImgUpload(".inpImg1");
		  MTools.ininDatetimepicker({
				format : "yyyy-mm-dd",  
				//默认显示年与日，如果想显示十分秒:"yyyy-mm-dd hh:ii:ss"
				minView : "month", 
				//"month",只显示年月日的选择,不会再跳转去选择时分秒；如果想要选择时分秒的:"hour"
				todayBtn : "linked",
				todayHighlight : true,
				listenBlur : false,
			});
	})

	function fb(){
		$('#hacStatus').val('2');
		myForm.submit();
	}
	
	function bc(){
		$('#hacStatus').val('${obj.hacStatus}');
		myForm.submit();
	}
</script>
</body>
</html>